const path = require('path');
module.exports = {
    devServer: {
        port: 8086,
        inline: true,
        hotOnly: false,
        hot: false,
        open: true,
        proxy: {
            '/api': {
                target: 'http://120.77.52.85:8080',
                pathRewrite: {
                    '/api': '', // 替换/api
                },
                bypass: (req) => {
                    req.headers.host = '120.77.52.85:8080';
                }
            }
        }
    },
    chainWebpack: config => {
        config.resolve.alias.set('utils', path.resolve(__dirname, './src/utils'));
        config.resolve.alias.set('api', path.resolve(__dirname, './src/utils/api'));
    }
}